﻿using SimpleFatocyPattern.Product;

namespace SimpleFatocyPattern.Factory
{
    internal class SimpleCarFactory
    {
        public static BaseProduct CreateProduct(ProductType productType)
        {
            BaseProduct? product = default;
            switch (productType)
            {
                case ProductType.BYD:
                    product = new BYDProduct();
                    break;

                case ProductType.AUDI:
                    product = new AUDIProduct();
                    break;

                default:
                    break;
            }
            product?.Prepare();
            product?.CreateEngine();
            product?.CreateWheel();
            product?.CreateComplete();
            return product;
        }
    }
}